<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
 <link rel="stylesheet" href="../static/css/back/font.css">
    <link rel="stylesheet" href="../static/css/back/xadmin.css">
    <script type="text/javascript" src="../static/js/jquery-2.1.1.min.js"></script>
    
    <script type="text/javascript" src="../static/js/back/xadmin.js"></script>
    <script type="text/javascript" src="../static/js/back/utils.js"></script>
    <script type="text/javascript" src="../static/js/back/ajax.js"></script>
<!--     <script type="text/javascript" src="../static/js/back/banner-list.js"></script> -->
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<style type="text/css">
tr td:nth-child(1) {
	text-align: left;
	border-right: none;
}

tr td:nth-child(2) {
	text-align: right;
	border-left: none;
}
</style>
</head>
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="javascript:;">首页</a>
        <a href="javascript:;">桌台管理</a>
        <a href="javascript:;"><cite>呼叫服务</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="iconfont icon-refresh right-top-ref" ></i></a>
    </div>
    <div class="x-body">
      <!-- <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">
          <input class="layui-input" placeholder="开始日" name="start" id="start">
          <input class="layui-input" placeholder="截止日" name="end" id="end">
          <input type="text" name="username"  placeholder="请输入用户名" autocomplete="off" class="layui-input">
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
      </div> -->
      <xblock>
<!--         <button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button> -->
<!--         <button class="layui-btn" onclick="x_admin_show('添加管理员','./banner-add.html?type=add',551,580)"><i class="layui-icon"></i>添加</button> -->
        <span class="x-right" style="line-height:40px">共有数据：0 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
        </thead>
        <tbody>
        </tbody>
      </table>
      <div class="layui-form-mid layui-word-aux no-more-data hide">暂无更多数据</div>
      <div class="page mypage" ></div> 
      </div>
    <script>
    var spid = getCookie("shop_id");
      layui.use('layer', function(){
        var layer = layui.layer
        ,$ = layui.jquery;
        
	        
      });
      
     
      var _pageNum = 1;
      $(function(){
    	  getList();
    	  $("body").on("click",".mypage span",function(){
    		  _pageNum = $(this).attr("data-status");
    		  console.log(_pageNum);
    		  getList();
    	  })
    	});
      function getList(){
    	  _ajax_get('../table/getServerList',{shopId:spid,pageNum:_pageNum},function(res){
	  		  console.log(res.returnObject);
	  		  if(!res.returnObject||res.returnObject.length<=0 ){
	  			  $(".layui-table tbody").html("");
	  			  $(".no-more-data").show();
	  			  return;
	  		  }else{
	  			  $(".no-more-data").hide();
	  		  }
	  		  var html = "";
	  		  if(!res.returnObject){
	  			  html = '<div class="layui-form-mid layui-word-aux no-more-data">暂无更多数据</div>';
	  			  $(".layui-table ").after(html);
	  			  return;
	  		  }
	  		  var stat = "" , statHtml = "";
	  		  showPageInfo(res.returnObject);
	  		  $(".x-right").text("共有数据："+res.returnObject.total +" 条");
	  		  $.each(res.returnObject.list,function(i,v,arr){
	  			  html+=' <tr><td>'+v.title
	      	             +'</td>                                                                                           '
	//      	             +' <td>'+v.adUrl+'</td>                                                                                                      '
	      	             +' <td>'+v.createTime+'</td>                                                                                                      '
	      	             +'    </tr>';
	  		  })
	  		  $(".layui-table tbody").html(html);
	  	  })
      }
      
    </script>

  </body>

</html>